                    <!--{hook thread_list_inc_start.htm}-->

                    <?php
                    if($threadlist) {
                        $have_allowtop = 0;
                        foreach($threadlist as &$_thread) {
                            $_thread['allowtop'] = forum_access_mod($_thread['fid'], $gid, 'allowtop');
                            if($_thread['allowtop']) $have_allowtop = 1;
                        }
                    }
                    ?>

                    <?php if($threadlist) { foreach($threadlist as &$_thread) { ?>
                    <li class="media thread tap <?php echo $_thread['top_class'];?>" data-href="<?php echo url("thread-$_thread[tid]");?>" data-tid="<?php echo $_thread['tid'];?>">
                        <div class="DiscussionListItem media-body">
                            <div class="ButtonGroup DiscussionListItem-controls">
                                <?php if($have_allowtop) { ?>
                                    <?php if($_thread['allowtop']) { ?>
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input" name="modtid" id="Check<?php echo $_thread['tid'];?>" value="<?php echo $_thread['tid']; ?>">
                                        <label class="custom-control-label" for="Check<?php echo $_thread['tid'];?>"></label>
                                    </div>
                                    <?php } ?>
                                <?php } ?>
                            </div>
                            <div class="DiscussionListItem-content Slidable-content subject">
                                <a href="<?php echo url("user-$_thread[uid]");?>" tabindex="-1" class="DiscussionListItem-author">
                                    <img class="Avatar lazy" data-original="<?php echo $_thread['user_avatar_url'];?>">
                                </a>
                                <?php if($_thread['top'] || $_thread['closed'] || $_thread['digest']) { ?>
                                <ul class="DiscussionListItem-badges badges">
                                    <?php if($_thread['top'] > 0) { ?>
                                    <li class="item-sticky">
                                        <span class="Badge Badge--sticky" data-toggle="tooltip" title="置顶">
                                            <i class="icon fa fa-fw fa-thumb-tack Badge-icon"></i>
                                        </span>
                                    </li>
                                    <?php } ?>
                                    <?php if($_thread['closed'] > 0) { ?>
                                    <li class="item-locked">
                                        <span class="Badge Badge--locked" data-toggle="tooltip" title="锁定">
                                            <i class="icon fa fa-fw fa-lock Badge-icon"></i>
                                        </span>
                                    </li>
                                    <?php } ?>
                                    <?php if($_thread['digest'] > 0) { ?>
                                    <li class="item-subscription">
                                        <span class="Badge Badge--following" data-toggle="tooltip" title="精华">
                                            <i class="icon fa fa-fw fa-diamond Badge-icon"></i>
                                        </span>
                                    </li>
                                    <?php } ?>
                                </ul>
                                <?php } ?>
                                <a href="<?php echo url("thread-$_thread[tid]");?>" class="DiscussionListItem-main">
                                    <h3 class="DiscussionListItem-title"><?php echo $_thread['subject'];?></h3>
                                    <ul class="DiscussionListItem-info">
                                        <li class="item-tags">
                                        <?php if(!$fid) { ?>
                                            <span class="TagsLabel tags-<?php echo $_thread['fid']; ?>">
                                                <span class="TagLabel colored">
                                                    <span class="TagLabel-text"><?php echo $_thread['forumname'];?></span>
                                                </span><?php if(!empty($_thread['taglist'])) { foreach($_thread['taglist'] as $tag) { ?><span class="TagLabel colored tag-id"><?php echo $tag['name'];?></span>
                                                <?php }} ?>
                                            </span>
                                        <?php } ?>
                                        </li>
                                        <li class="item-terminalPost">
                                            <!--{hook thread_list_inc_lastuid_before.htm}-->
                                            <span>
                                            <?php if($_thread['lastuid']) { ?>
                                                <i class="icon fa fa-reply"></i>
                                                <span class="username" uid="<?php echo $_thread['lastuid'];?>"><?php echo $_thread['lastusername'];?></span> 回复于
                                                <span><?php echo $_thread['last_date_fmt'];?></span>
                                            <?php } else { ?>
                                                <!--{hook thread_list_inc_username_before.htm}-->
                                                <span class="username" uid="<?php echo $_thread['uid'];?>"><?php echo $_thread['username'];?></span> 发表于
                                                <span><?php echo $_thread['create_date_fmt'];?></span>
                                                <!--{hook thread_list_inc_username_after.htm}-->

                                            <?php } ?>
                                            </span>
                                            <!--{hook thread_list_inc_lastuid_after.htm}-->
                                        </li>
                                    <?php
                                        $post = post_read($_thread['firstpid']);
                                        $content =($post['message_fmt']);
                                        $message = strip_tags($content);
                                        $excerpt = mb_substr($message,0,50,'utf-8');
                                    ?>
                                    <?php if($_thread['top'] > 0) { ?>
                                        <li class="item-excerpt"><span><?php echo $excerpt; ?>...</span></li>
                                    <?php } ?>
                                    </ul>
                                </a>
                                <span class="DiscussionListItem-count"><?php echo $_thread['posts'];?></span>
                            </div>
                        </div>
                    </li>
                    <?php }} else { ?>
                    <li>
                        <div id="flarum-loading"><?php echo lang('none');?></div>
                    </li>
                    <?php } ?>
                    <!--{hook thread_list_inc_end.htm}-->